home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / include / vms / param.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-07  |  4.9 KB  |  167 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.  The Berkeley software License Agreement
  4.  * specifies the terms and conditions for redistribution.
  5.  *
  6.  *    @(#)param.h    7.1 (Berkeley) 6/4/86
  7.  */
  8.  
  9. #define    BSD    43        /* 4.3 * 10, as cpp doesn't do floats */
  10. #define BSD4_3    1
  11.  
  12. #define    NPTEPG        (NBPG/(sizeof (struct pte)))
  13.  
  14. /*
  15.  * Machine-independent constants
  16.  */
  17. #define    NMOUNT    20        /* number of mountable file systems */
  18. /* NMOUNT must be <= 255 unless c_mdev (cmap.h) is expanded */
  19. #define    MSWAPX    NMOUNT        /* pseudo mount table index for swapdev */
  20. #define    MAXUPRC    40        /* max processes per user */
  21. #define    NOFILE    64        /* max open files per process */
  22. #define    CANBSIZ    256        /* max size of typewriter line */
  23. #define    NCARGS    20480        /* # characters in exec arglist */
  24. #define    NGROUPS    16        /* max number groups */
  25.  
  26. #define    NOGROUP    65535        /* marker for empty group set member */
  27.  
  28. /*
  29.  * Priorities
  30.  */
  31. #define    PSWP    0
  32. #define    PINOD    10
  33. #define    PRIBIO    20
  34. #define    PRIUBA    24
  35. #define    PZERO    25
  36. #define    PPIPE    26
  37. #define    PWAIT    30
  38. #define    PLOCK    35
  39. #define    PSLEP    40
  40. #define    PUSER    50
  41.  
  42. #define    NZERO    0
  43.  
  44. #include <signal.h>
  45.  
  46. #define    ISSIG(p) \
  47.     ((p)->p_sig && ((p)->p_flag&STRC || \
  48.      ((p)->p_sig &~ ((p)->p_sigignore | (p)->p_sigmask))) && issig())
  49.  
  50. #define    NBPW    sizeof(int)    /* number of bytes in an integer */
  51.  
  52. #define    NULL    0
  53. #define    CMASK    026        /* default mask for file creation */
  54.                 /* was 022, changed 1/15/87 SMS   */
  55. #define    NODEV    (dev_t)(-1)
  56.  
  57. /*
  58.  * Clustering of hardware pages on machines with ridiculously small
  59.  * page sizes is done here.  The paging subsystem deals with units of
  60.  * CLSIZE pte's describing NBPG (from vm.h) pages each.
  61.  *
  62.  * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE
  63.  */
  64. #define    CLBYTES        (CLSIZE*NBPG)
  65. #define    CLOFSET        (CLSIZE*NBPG-1)    /* for clusters, like PGOFSET */
  66. #define    claligned(x)    ((((int)(x))&CLOFSET)==0)
  67. #define    CLOFF        CLOFSET
  68. #define    CLSHIFT        (PGSHIFT+CLSIZELOG2)
  69.  
  70. #if CLSIZE==1
  71. #define    clbase(i)    (i)
  72. #define    clrnd(i)    (i)
  73. #else
  74. /* give the base virtual address (first of CLSIZE) */
  75. #define    clbase(i)    ((i) &~ (CLSIZE-1))
  76. /* round a number of clicks up to a whole cluster */
  77. #define    clrnd(i)    (((i) + (CLSIZE-1)) &~ (CLSIZE-1))
  78. #endif
  79.  
  80. /* CBLOCK is the size of a clist block, must be power of 2 */
  81. #define    CBLOCK    64
  82. #define    CBSIZE    (CBLOCK - sizeof(struct cblock *))    /* data chars/clist */
  83. #define    CROUND    (CBLOCK - 1)                /* clist rounding */
  84.  
  85. #ifdef    VMS
  86. #include    "types.h"
  87. #endif
  88.  
  89. /*
  90.  * File system parameters and macros.
  91.  *
  92.  * The file system is made out of blocks of at most MAXBSIZE units,
  93.  * with smaller units (fragments) only in the last direct block.
  94.  * MAXBSIZE primarily determines the size of buffers in the buffer
  95.  * pool. It may be made larger without any effect on existing
  96.  * file systems; however making it smaller make make some file
  97.  * systems unmountable.
  98.  *
  99.  * Note that the blocked devices are assumed to have DEV_BSIZE
  100.  * "sectors" and that fragments must be some multiple of this size.
  101.  * Block devices are read in BLKDEV_IOSIZE units. This number must
  102.  * be a power of two and in the range of
  103.  *    DEV_BSIZE <= BLKDEV_IOSIZE <= MAXBSIZE
  104.  * This size has no effect upon the file system, but is usually set
  105.  * to the block size of the root file system, so as to maximize the
  106.  * speed of ``fsck''.
  107.  */
  108. #define    MAXBSIZE    8192
  109. #define    DEV_BSIZE    512
  110. #define    DEV_BSHIFT    9        /* log2(DEV_BSIZE) */
  111. #define BLKDEV_IOSIZE    2048
  112. #define MAXFRAG     8
  113.  
  114. #define    btodb(bytes)             /* calculates (bytes / DEV_BSIZE) */ \
  115.     ((unsigned)(bytes) >> DEV_BSHIFT)
  116. #define    dbtob(db)            /* calculates (db * DEV_BSIZE) */ \
  117.     ((unsigned)(db) << DEV_BSHIFT)
  118.  
  119. /*
  120.  * Map a ``block device block'' to a file system block.
  121.  * This should be device dependent, and will be after we
  122.  * add an entry to cdevsw for that purpose.  For now though
  123.  * just use DEV_BSIZE.
  124.  */
  125. #define    bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
  126.  
  127. /*
  128.  * MAXPATHLEN defines the longest permissable path length
  129.  * after expanding symbolic links. It is used to allocate
  130.  * a temporary buffer from the buffer pool in which to do the
  131.  * name expansion, hence should be a power of two, and must
  132.  * be less than or equal to MAXBSIZE.
  133.  * MAXSYMLINKS defines the maximum number of symbolic links
  134.  * that may be expanded in a path name. It should be set high
  135.  * enough to allow all legitimate uses, but halt infinite loops
  136.  * reasonably quickly.
  137.  */
  138. #define MAXPATHLEN    1024
  139. #define MAXSYMLINKS    8
  140.  
  141. /*
  142.  * bit map related macros
  143.  */
  144. #define    setbit(a,i)    ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
  145. #define    clrbit(a,i)    ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
  146. #define    isset(a,i)    ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
  147. #define    isclr(a,i)    (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
  148.  
  149. /*
  150.  * Macros for fast min/max.
  151.  */
  152. #define    MIN(a,b) (((a)<(b))?(a):(b))
  153. #define    MAX(a,b) (((a)>(b))?(a):(b))
  154.  
  155. /*
  156.  * Macros for counting and rounding.
  157.  */
  158. #ifndef howmany
  159. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  160. #endif
  161. #define    roundup(x, y)    ((((x)+((y)-1))/(y))*(y))
  162.  
  163. /*
  164.  * Maximum size of hostname recognized and stored in the kernel.
  165.  */
  166. #define MAXHOSTNAMELEN    64
  167.